using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace Marlimer.Common
{
    public class loadXML
    {
        public List<InfoParamXML> configbd = new List<InfoParamXML>();
        public List<InfoParamXML> parame = new List<InfoParamXML>();
        

        public Boolean load()
        {
            Boolean resul = false;
             
            try
            {
                XmlTextReader xmlread = new XmlTextReader("inicio.xml");

                while (xmlread.Read())
                {
                    // Move to fist element

                    xmlread.MoveToElement();
                    //segun si es tipo elemento tomamos el nombre
                    if (xmlread.NodeType == XmlNodeType.Element)
                    {
                        //preguntamos si es config o si es parametro
                        String nameElem = xmlread.Name.ToLower();

                        switch (nameElem)
                        {
                            case "conf_bd":
                                {
                                    
                                    break;
                                }
                            case "params":
                                {

                                    break; 
                                }
                        }

                        
                    }
                    
                    Console.WriteLine("XML lector");
                    Console.WriteLine("===================");
                    // Read this element's properties and display them on console
                    Console.WriteLine("Name:" + xmlread.Name);


                    Console.WriteLine("Base URI:" + xmlread.BaseURI);
                    Console.WriteLine("Local Name:" + xmlread.LocalName);
                    Console.WriteLine("Attribute Count:" + xmlread.AttributeCount.ToString());
                    Console.WriteLine("Depth:" + xmlread.Depth.ToString());
                    Console.WriteLine("Line Number:" + xmlread.LineNumber.ToString());
                    Console.WriteLine("Node Type:" + xmlread.NodeType.ToString());
                    Console.WriteLine("Attribute Count:" + xmlread.Value.ToString());
                }

                resul = true;
            }
            catch (Exception ex)
            {
                Console.Write(ex.Message);  
            }

            return resul;
        }
    }
}
